<template>
  <div id="nav">
    <!-- 修改数据，测试是否持久化 -->
    <p>{{$store.state.user.profile.account}}</p>
    <!-- <button @click="$store.commit('user/setUser',{account:'wyy'})">修改数据</button><br> -->
    <button @click="btnClick">修改数据</button>
    <button @click="getUserInfo">获取用户信息</button>
  </div>
</template>

<script>
  import { useStore } from 'vuex'
  import request from '@/utils/request.js'
  export default({
    setup() {
      const store = useStore()
      const btnClick = () => {
        store.commit('user/setUser',{account:'wyy'})
      }

      const getUserInfo = () => {
        request('/member/profile','get')
      }
      return { btnClick, getUserInfo }
    },
  })
</script>


<style scoped lang="less">

</style>
